#include "SelectEffect.h"


SelectEffect::SelectEffect(void)
{
}


SelectEffect::~SelectEffect(void)
{
}

bool SelectEffect::init(){
	CCSize size = CCDirector::sharedDirector()->getWinSize();
	int WIN_W = size.width;
	int WIN_H = size.height;

	CCActionInterval* action = CCRepeatForever::create(
		CCSequence::create(
		CCMoveBy::create(0.25f,ccp(0,TILE_SIZE)),
		CCMoveBy::create(0.25f,ccp(TILE_SIZE,0)),
		CCMoveBy::create(0.25f,ccp(0,-TILE_SIZE)),
		CCMoveBy::create(0.25f,ccp(-TILE_SIZE,0))
		,NULL)
		);
	CCActionInterval* action2 = CCRepeatForever::create(
		CCSequence::create(
		CCMoveBy::create(0.25f,ccp(0,TILE_SIZE)),
		CCMoveBy::create(0.25f,ccp(TILE_SIZE,0)),
		CCMoveBy::create(0.25f,ccp(0,-TILE_SIZE)),
		CCMoveBy::create(0.25f,ccp(-TILE_SIZE,0))
		,NULL)
		);
	CCParticleSystem* emitter = loadParticale();
	emitter->runAction(action);
	CCSprite* star = CCSprite::create("star1.png");
	addChild(star);
	star->runAction(action2);
	star->runAction(CCRepeatForever::create(CCRotateBy::create(0.25f,360)));

	return true;
}

CCParticleSystem* SelectEffect::loadParticale(){
	CCParticleSystem* emitter = CCParticleSystemQuad::create("selectlight.plist");
	addChild(emitter, 10);
	return emitter;
}
